<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@page import="com.is.util.ParamUtil"%>
<%@page import="com.is.model.ParamCourseScoreGS"%>
<%@page import="com.is.control.ParamCourseScoreGSControl"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>设定本学期总成绩计算公式</title>
</head>

<body>
<%
          int courseClassId =(Integer) session.getAttribute("courseClassId");
          String dailyPer = ParamUtil.getString(request,"daily");
          String midPer = ParamUtil.getString(request,"mid");
          String finalPer = ParamUtil.getString(request,"final");
          ParamCourseScoreGS csgs = new ParamCourseScoreGS();
          if(ParamCourseScoreGSControl.isInserted(courseClassId)){
        	  csgs = ParamCourseScoreGSControl.getGSByCourseClassId(courseClassId);
          }
          csgs.setCourseClassId(courseClassId);
          csgs.setDailyScore_per(dailyPer);
          csgs.setMiderScore_per(midPer);
          csgs.setFinalScore_per(finalPer);
          if(ParamCourseScoreGSControl.isInserted(courseClassId)){
        	  if(ParamCourseScoreGSControl.updateGS(csgs,csgs.getId())){
        		  out.print("成功修改");
        	  }
          }else{
        	  if(ParamCourseScoreGSControl.insertGS(csgs)){
        		  out.print("成功设置");
              }
          }
        
%>
</body>
</html>